Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent from failing using an extra protocol in resolver's URL #48

Merged
merged 5 commits into from
Mar 2, 2024

Conversation

rolang
Copy link
Contributor

@rolang rolang commented Mar 2, 2024

Hi, after we added a resolver with a custom protocol in the URL, like artifactregistry://example.com/maven we got java.net.MalformedURLException exceptions from this plugin. I tried to change it to use java.net.URI instead, but it was throwing exceptions in another place, so I tried to get the host from one of them as in this PR and it seemed to work.

Example URL/URI outputs:

scala> URI("artifactregistry://example.com").getHost
val res2: String = example.com
                                                                                                                                                                                                                 
scala> URL("artifactregistry://example.com").getHost
java.net.MalformedURLException: unknown protocol: artifactregistry

Related PR on extra protocol handlers: scala-steward-org/scala-steward#2628

Copy link
Member

@fthomas fthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @rolang!

@fthomas fthomas merged commit 0b0f9a6 into scala-steward-org:main Mar 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants